package com.thb.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.thb.pay.core.utils.PageResult;
import com.thb.pay.db.service.impl.BaseServiceImpl;
import com.thb.pay.db.utils.PageResultUtils;
import com.thb.pay.db.utils.PageUtils;
import com.thb.pay.db.utils.QueryUtils;
import com.thb.pay.entity.SysUser;
import com.thb.pay.mapper.SysUserMapper;
import com.thb.pay.service.SysUserService;
import com.thb.pay.vo.req.SysUserPageReq;
import com.thb.pay.vo.resp.SysUserVo;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统-用户表 服务实现类
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@Service
public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Override
    public PageResult<SysUserVo> findPage(SysUserPageReq pageReq) {
        IPage<SysUser> currentPage = PageUtils.buildPage(pageReq);
        QueryWrapper wrapper = QueryUtils.buildQueryPage(pageReq);
        IPage<SysUser> pageResult = super.page(currentPage, wrapper);
        return PageResultUtils.build(pageResult, SysUserVo.class);
    }
}
